<?php
!defined('M_P') && exit('Forbidden');
InitGP(array('q','a'));
if (strpos ( $q, '..' ) !== false) {
	Showmsg ( 'undefined_action' );
}
include_once (D_P . 'data/bbscache/house_config.php');
require_once (M_P . 'require/core.php');
$newHouseControllers = array(
	'album',
	'calculate',
	'evaluations',
	'feed',
	'groupbuy',
	'housemap',
	'image_xml',
	'image',
	'info',
	'list',
	'pricedetail',
	'upload',
	'video',
	'new',
	'developer'
);
!$m && $m = 'house';
define("BASEURL", "index.php?m=$m&");
$houseBaseUrl = BASEURL;
//默认首页设置
if($house_newhouseifopen && $house_secondhouseifopen){
	 $q = !$q ? $house_defaultindex  ? '' : 'index' : $q;
}else{
	 $q = !$q ? $house_secondhouseifopen  ? 'index' : '' : $q;
}
if ($q && !in_array($q,$newHouseControllers) && $house_secondhouseifopen) {
	House::loadClass('houseurl','utility',false);
	define("MODE", M_P);
	define("APPLICATION", MODE . "application");
	define("APP_VIEWER", APPLICATION . "/front/viewer/");
	define("APP_CONTROLLER", APPLICATION . "/front/controller/");
	define('IMG_PATH','mode/house/images/sendhand');
	$configs = array(
		'c' => $q,
		'a' => $a
	);
	
	$router = L::loadClass("router", "framework");
	$router->run($configs);
	exit();
}

if ($q && in_array($q,$newHouseControllers) && $house_newhouseifopen && $q != 'new') {
	$baseUrl = "index.php?m=$m";
	$basename = "index.php?m=$m&";
	$tname = ($q != "user" && isset($winddb['username'])) ? $winddb['username'].' - ' : '';
	isset($o_navinfo['KEY'.$q]) && $webPageTitle = strip_tags($o_navinfo['KEY'.$q]['html']).' - '.$tname.$webPageTitle;
	unset($tname);
	
	require_once Pcv ( M_P . "m_{$q}.php" );
	exit();
}

if ($house_newhouseifopen) {
	require_once (M_P . 'require/header.php');
	require_once PrintEot('index');
	footer();
}

if(!$house_newhouseifopen && !$house_secondhouseifopen){
	Showmsg('房产模式未开启');
}else{
	if($house_secondhouseifopen) ObHeader('index.php?m=house&q=sale&q=index');
}
?>